extends Sprite2D

signal shoot(bullet, direction, location)

var Bullet = preload("res://circle/bullet.tscn")

func _unhandled_input(event):
	if event is InputEventMouseButton:
		if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
			print(position)
			print(rotation)
			shoot.emit(Bullet, rotation- PI/2, position)

func _process(delta):
	look_at(get_global_mouse_position())
	rotation += PI/2
	rotation = clamp(rotation,-PI/3,PI/3)
